{extend name="Public:content"}
{block name="content"}
<form class="form-horizontal m-t" id="setFanTagForm"  method="post" action='{:url("admin/wechatFans/tagSet")}'>
    <div class="form-group">
        <label class="col-sm-2 control-label">选择标签：</label>
        <div class="col-sm-8">
            <div class="checkbox i-checks">
                {volist name="vo.tag_list" id="tag"}
                {if in_array($key,$vo['tagid_list'])}
                <label {eq name="i" value="1"}style="padding-left:0"{/eq}><input type="checkbox"  value="{$key}" name="tag_ids[]" checked> <i></i> {$tag}</label>
                {else}
                <label {eq name="i" value="1"}style="padding-left:0"{/eq}><input type="checkbox"  value="{$key}" name="tag_ids[]"> <i></i> {$tag}</label>
                {/if}
                {/volist}
            </div>
        </div>
    </div>
    <div class="hr-line-dashed"></div>
    <div class="form-group">
        <div class="col-sm-12 text-center">
            {if isset($vo['id'])}<input type='hidden' value='{$vo.id}' name='id'/>{/if}
            <button class="btn btn-primary" type="submit">保存数据</button>
            <button class="btn btn-primary btn-danger" type='button' data-confirm="确定要取消编辑吗？" onclick="$.Oa.confirm(this)">取消编辑</button>
        </div>
    </div>
</form>
{/block}
{block name="script"}
<script type="text/javascript">
    //表单提交
    $('#setFanTagForm').validate({
        submitHandler: function(form) {
            $.Oa.doHform('#setFanTagForm',false,false,function(data){
                parent.layer.msg(data.msg);
                var iframe ='{$iframe}';
                var n = parent.$("iframe[name='"+iframe+"']").index();
                parent[n].$('#table').bootstrapTable('refresh');
                var index = parent.layer.getFrameIndex(window.name);
                parent.layer.close(index);
            })
        }
    })
</script>
{/block}